package app.structure;

import java.util.ArrayList;
import java.util.List;

public class MenuStruct implements Cloneable {
	private String id; 
	// id of element
	// Remarks: Procedures, transactions and reports are the same but only
	// changes the icon
	private String typ;
	// Type: M->Menu Folder,
	// F-> Class Form (with parameters),
	// P-> Procedure/Program (with parameters and form)
	// R-> Report (with parameters and form),
	// T-> Transaction (with parameters and form)
	private String parent;
	// Parent id or name (only a menu folder or null)
	private String name;
	// Name to i18n
	private int secLevel;
	// Security level: 0:Nothing, 1:See, 2:Print, 3:Edit,
	// 4:New, 5:Copy, 6:Delete, 7:Transaction,
	// 8:Application admin, 9:Global administrator

	private List<MenuStruct> menuSt;// Child menu Structure

	public MenuStruct() {
		setMenuSt(new ArrayList<MenuStruct>());
	}

	public Object clone() {
		try {
			return super.clone();
		} catch (CloneNotSupportedException e) {
			throw new InternalError(e.toString());
		}
	}

	public String getId() {
		return id;
	}

	@Override
	public String toString() {
		return "MenuStruct [id=" + id + ", typ=" + typ + ", parent=" + parent
				+ ", name=" + name + ", secLevel=" + secLevel + ", menuSt="
				+ menuSt + "]";
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTyp() {
		return typ;
	}

	public void setTyp(String typ) {
		this.typ = typ;
	}

	public String getParent() {
		return parent;
	}

	public void setParent(String parent) {
		this.parent = parent;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getSecLevel() {
		return secLevel;
	}

	public void setSecLevel(int secLevel) {
		this.secLevel = secLevel;
	}

	public List<MenuStruct> getMenuSt() {
		return menuSt;
	}

	public void setMenuSt(List<MenuStruct> menuSt) {
		this.menuSt = menuSt;
	}

}
